#ifndef AFX_SDKJSON_H
#define AFX_SDKJSON_H


#define JSONDATEMAXLEN 1024

typedef void *SDK_JSON_HAND;
typedef void *SDK_JSON_ARRAY;

typedef SDK_JSON_HAND (*pDecodeFun)(char *pJsonData);

typedef char *(*pEncodeFun)(SDK_JSON_HAND hand);

int snprintf(char *str, unsigned int size, const char *format, ...);

extern int sdkInitJson(SDK_JSON_HAND pfJson, char *tag, int type);

extern int sdkSetJsonNumValue(SDK_JSON_HAND hand, const char *pJsonTag, double JsonValue);

extern int sdkSetJsonStrValue(SDK_JSON_HAND hand, const char *pJsonTag, char *pJsonValue);

extern int sdkSetJsonObjValue(SDK_JSON_HAND hand, const char *pJsonTag, SDK_JSON_HAND pJsonValue);

extern int sdkSetJsonArrValue(SDK_JSON_HAND hand, const char *pJsonTag, SDK_JSON_HAND pJsonValue);

extern int sdkSortJson(SDK_JSON_HAND hand);

extern int sdkGetJsonValue(SDK_JSON_HAND hand, const char *pJsonTag, u8 **JsonValue);

extern char *base64_encode(const unsigned char *bindata, char *base64, int binlength);

extern int base64_decode(const char *base64, unsigned char *bindata);

extern s32 sdkParseJsonMember(s8 *pinput, s8 *pmembername, s8 *membervalue);

#endif

